import Message from './Message.vue'
const install = (Vue, options) => {
  // 1. 添加全局方法或 property
  Vue.prototype.$message = (methodOptions) => {
    const MessageConstructor = Vue.extend(Message)
    const instance = new MessageConstructor()
    instance.vm = instance.$mount()
    document.body.appendChild(instance.vm.$el)
    instance.vm.message(methodOptions)
    setTimeout(() => {
      document.body.removeChild(instance.vm.$el)
    }, 3000)
  }
}
export default { install }
